import React from 'react';
import {inject, observer} from 'mobx-react';
import {toJS} from 'mobx';
import {WeaAuth} from 'ecCom';
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

@inject('blogSetting')
@observer
export default class ShareAddModule extends React.Component {
  render() {
    const {blogSetting} = this.props;
    const {showShare, shareList, editId} = toJS(blogSetting.moduleStatus);

    return (
      <WeaAuth ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@prc96h`}
        icon='icon-coms-meeting'
        iconBgcolor='#F14A2D'
        title={getLabel(383335,'添加共享范围')}
        width={600}
        visible={showShare}
        conditions={shareList}
        onOk={datas => {
          blogSetting.operateBlogTemplateShare({operation: 'saveTempShare', tempid: editId, ...datas});
        }}
        onCancel={() => {
          blogSetting.setModuleState({showShare: false});
        }}
      >
      </WeaAuth>
    )
  }
}